#ifndef INPUT_DIALOG_H
#define INPUT_DIALOG_H

#include <QtGui/QDialog>
#include <QtGui/QLineEdit>
#include <QtGui/QValidator>

namespace gui
{

class InputDialog : public QDialog
{
    Q_OBJECT

public:
    static QString getText(QWidget* parent, const QString& title,
        const QString& label, const QString& inputMask = QString(),
        QSharedPointer<QValidator> validator = QSharedPointer<QValidator>(),
        QLineEdit::EchoMode mode = QLineEdit::Normal,
        const QString& text = QString(), bool* ok = 0);

    static QString getTextFromConstraints(QWidget* parent,
        const QString& title, const QString& label,
        const QStringList& constraints, bool* ok);

private:
    InputDialog(QWidget* parent = 0);
    ~InputDialog();

private slots:
    void checkText(const QString& text);

private:
    bool m_ok;
    static QPushButton* m_okButton;
};

}

#endif
